1. Field of the Invention
This invention relates to a factory automation (FA) system and more particularly to a central controller such as a personal computer for controlling controllers, such as a programmable controller (PC), a numerical control (NC), a servo controller (SC), and a robot controller (RC), a control method of the central controller, and a recording medium recording a program.
2. Description of the Related Art
In recent years, occasions where a program logic controller (PLC) system, an NC system, an SC system, and an RC system (containing a combination thereof) are connected to a personal computer for use have increased because of enrichment of data processing and man-machine interfaces. Available as a system connecting them is, for example, a system used as system monitoring or an input/output interface (display, etc.,).
Hitherto, to develop such an application program, a library provided for each of the PLC, NC, SC, and RC systems has been used.
FIG. 12 is a functional block diagram of an FA system described in JP-A-09-050312. In FIG. 12, numeral 103 denotes a PLC controlled by a controller, numeral 111 denotes a PLC communication board placed in the controller for communicating with the PLC 103, numerals 113, 116, and 118 denote memories used for processing of the controller, and numeral 113a denotes a user program for transmitting and receiving data to and from the PLC 103.
Next, transmission and reception of data in the FA system will be discussed. First, the user program 113a writes a transmission request into a request data area 116a. Subsequently, a transmission and reception function 118a reads the transmission request written into the request data area 116a, determines the party to which the transmission request is to be sent based on the channel number described in the transmission request, and sends the transmission request to the PLC 103 through a PLC communication function 118e and the PLC communication board 111, for example. The PLC 103 responds to the transmission request with necessary data and the transmission and reception function 118a receives the data through the PLC communication function 118e and the PLC communication board 111 and writes the received data into a response data area 116b, then the user program 113a reads the data from the response data area 116b. 
The access system in the related art is thus configured and therefore involves the following problem:
The FA system in the related art uses the channel number for making it possible to transmit and receive data and comprises one transmission and reception function to change the party to and from which data is to be transmitted and received based on the channel number. That is, one transmission and reception function 118a manages all transmission and reception of the user program 113a. Since instructions sent to the transmission and reception function 118a are processed sequentially, if a time-consuming instruction and an instruction that can be processed at high speed are mixed, the instruction that can essentially be processed at high speed must wait until completion of the time-consuming instruction and processing cannot be speeded up.
It is therefore an object of the invention to provide an FA system control method capable of executing a plurality of instructions efficiently, a recording medium recording a program therefor, and a central controller.
To the end, according to the invention, there is provided a control method of a factory automation system wherein a central controller for controlling a factory automation system using a plurality of controllers controls first and second ones of the controllers, the method comprising the generation step of starting a plurality of interface means by generating new interface means in addition to already existing interface means, the first transmission step of transmitting a first instruction for controlling the first controller to one of the interface means by control means being placed in the central controller and having a control procedure of the controllers, the second transmission step of transmitting by the control means a second instruction for controlling the second controller to different one of the interface means from the interface means to which the first instruction is transmitted, the parallel execution step being executed after the first and second transmission steps, the parallel execution step of executing the first instruction by the interface means and executing the second instruction by the different interface means in parallel with execution of the first instruction, the third transmission step being executed after the parallel execution step, the third transmission step of transmitting the process result for the first instruction to the control means by the interface means, the fourth transmission step being executed after the parallel execution step, the fourth transmission step of transmitting the process result for the second instruction to the control means by the different interface means, and the end step being executed after the fourth transmission step, the end step of releasing the resources occupied by the different interface means and terminating the different interface means.
The method further comprises the step being executed after the end step, the step of receiving the process result transmitted at the third transmission step and processing the received process result by the control means.
According to the invention, there is provided a recording medium recording a program for causing a computer to execute the generation step at which if a request for controlling a controller is issued from an application program to a library and a control process provided in the library is called, the library generates a new thread, whereby a plurality of threads are assigned to the library, the return step at which the library uses one of the threads to return execution right to the application program before the library receives the process result from the controller corresponding to the process of the controller, the first control step at which the library uses different one of the threads from the one thread to execute the process of the controller and control the controller in parallel with the application program restarting execution to which the execution right is returned at the return step, and the step being executed after the return step, the step of transmitting the process result of the controller from the library executed using the different thread to the application program executed using the one thread.
The recording medium records a program for causing a computer to execute the additional steps of the request step being executed after the return step at which the application program uses the one thread to request the library to control a different controller, the second control step at which the library receives the request made at the request step and controls the different controller in parallel with the first control step, and the end step being executed after the transmission step at which the library executed using the different thread terminates the different thread.
According to the invention, there is provided a central processor of a factory automation system comprising control means for issuing instructions to a plurality of controllers in parallel and controlling the controllers, a plurality of interface means for connecting the control means and the controllers, and interface control means for dynamically increasing or decreasing the number of the plurality of interface means in response to the number of the instructions issued by the control means to the controllers in parallel.
The interface control means senses that the control means sends an instruction to the interface means, and increases the interface means.
The interface control means increases the interface means in response to the type of instruction and for an instruction having a shorter processing time than the instruction for increasing the interface means has, the interface control means does not increase the interface means and causes already existing interface means to execute the instruction having a shorter processing time.